<template>
  <section>
    <ul>
      <li v-for="item in tableData" :key="item.name">
        <p>name: {{ item.name }}</p>
        <p>age: {{ item.age }}</p>
      </li>
    </ul>

    <button @click="handleClick">请求数据</button>
  </section>
</template>

<script>
import axios from "axios";
import { reactive } from "vue";

export default {
  setup() {
    let tableData = reactive([]);
    // let handleClick = function () {
      axios({
        url: "/api/api/emp/queryList",
      }).then((res) => {
        tableData.push(...res.data.result_data);
      });
    // };

    // handleClick();
    return { tableData, handleClick };
  },
};
</script>

<style>
</style>